package com.example.libbase.utils;

import com.google.gson.Gson;

import java.lang.ref.WeakReference;

/**
 * GSON工具类
 *
 * @author hermit
 * @date 2021/6/20 14:13
 */
public class GSON {

    private static WeakReference<Gson> instance;

    private GSON() {

    }

    private static Gson get() {
        if (instance == null ||instance.get() == null) {
            Gson gson = new Gson();
            instance = new WeakReference<>(gson);
        }
        return instance.get();
    }
}
